﻿using AutoMapper;
using RedDragon.Common.Domain.BoM;
using RedDragon.Common.Domain.Enterprise;
using RedDragon.Common.Domain.Manufacture;
using RedDragon.Common.Domain.MaterialManagements;
using RedDragon.Common.Domain.MaterialPlanning;
using RedDragon.Common.Domain.Outboundorder;
using RedDragon.Common.Domain.Process;
using RedDragon.Common.Domain.ProductionTasks;
using RedDragon.Common.Domain.Purchase;
using RedDragon.Common.Domain.Supplier;
using RedDragon.ERP.API.Application.Commands.BoM;
using RedDragon.ERP.API.Application.Commands.Department;
using RedDragon.ERP.API.Application.Commands.Enterprise;
using RedDragon.ERP.API.Application.Commands.MaterialManagements;
using RedDragon.ERP.API.Application.Commands.MaterialPlanning;
using RedDragon.ERP.API.Application.Commands.OutboundOrder;
using RedDragon.ERP.API.Application.Commands.Proccess;
using RedDragon.ERP.API.Application.Commands.ProductionTasks;
using RedDragon.ERP.API.Application.Commands.Purchases;
using RedDragon.ERP.API.Application.Commands.Resource;
using RedDragon.ERP.API.Application.Commands.Supplieries;
using RedDragon.ERP.API.Application.Commands.WorkCenter;

namespace RedDragon.ERP.API.Common
{
    /// <summary>
    /// 配置AutoMapper映射
    /// </summary>
    public class AutoMapperProfile : Profile
    {
        /// <summary>
        /// AutoMapperProfile
        /// 构造函数
        /// </summary>
        public AutoMapperProfile()
        {
            //物料清单添加
            CreateMap<CreateBoMCommand, BoMInform>();
            //物料管理添加
            CreateMap<CreateMaterialManagementCommand, MaterialManagement>();
            //添加企业 转换
            CreateMap<CreateEnterpriseCommand, Enterprises>();
            //物料管理添加
            CreateMap<CreateMaterialManagementCommand, MaterialManagement>();
            //工作中心添加
            CreateMap<CreateWorkCenterCommand, WorkCenters>();
            //添加部门 转换
            CreateMap<CreateDepartmentCommand, Departments>();
            //添加工艺路线 转换
            CreateMap<CreateProcessRouteCommand, ProcessRoutes>();
            //资源添加
            CreateMap<CreateResourceCommand, Resources>();
            //工作中心修改
            CreateMap<UpdateWorkCenterCommand, WorkCenters>();
            //物料类别添加
            CreateMap<CreateMaterialCategoryCommand, MaterialCategory>();
            //添加工艺路线工序
            CreateMap<CreateOperationCommand, ProcessLineOperations>();
            //添加供应商 转换
            CreateMap<CreateSupplierCommand, Suppliers>();
            //物料需求计划添加
            CreateMap<CreatePlanCommand, Plan>();
            //生产任务添加
            CreateMap<CreateProductionTasksCommand, Productiontasks>();
            //修改供应商 转换
            CreateMap<UpdateSupplierCommand, Suppliers>();
            //物料需求计划修改
            CreateMap<UpdatePlanCommand, Plan>();
            //生产任务修改
            CreateMap<UpdateProductionTasksCommand, Productiontasks>();
            //添加采购/委外订单 转换
            CreateMap<CreatePurchaseOutsourceCommand, PurchaseOutsources>();
            //添加采购/委外   订单行 转换
            CreateMap<CreateOrderBankCommand, OrderBanks>();
            //添加采购/委外   付款计划行 转换
            CreateMap<CreatePaymentCommand, Payments>();
            //出库单添加
            CreateMap<CreateOutboundCommand, Outbound>();
            //修改采购/委外信息 转换
            CreateMap<UpdatePurchaseCommand, PurchaseOutsources>();
            //出库单修改
            CreateMap<UpdateOutboundCommand, Outbound>();
        }
    }
}
